<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="include::head"></head>
<body>
<div class="layui-fluid">
    <!--form表单-->
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">任务名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" autocomplete="off" th:value="${quartz.name}" class="layui-input" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">表达式</label>
            <div class="layui-input-block">
                <input type="text" name="cron" th:value="${quartz.cron}" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">类名地址</label>
            <div class="layui-input-block">
                <input type="text" name="jobClassName"  th:value="${quartz.jobClassName}" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">方法名称</label>
            <div class="layui-input-block">
                <input type="text" name="jobName" th:value="${quartz.jobName}" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">任务组名</label>
            <div class="layui-input-block">
                <select name="type" lay-filter="filter">
                    <th:block th:each="value : ${diy['task_type']}">
                        <option th:if="${value.dictionaryRoute == quartz.type}" selected th:value="${value.dictionaryRoute}" th:utext="${value.dictionaryName}"></option>
                        <option th:if="${value.dictionaryRoute != quartz.type}" th:value="${value.dictionaryRoute}" th:utext="${value.dictionaryName}"></option>
                    </th:block>>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <th:block th:each="value: ${diy['state_type']}">
                        <input th:if="${value.dictionaryRoute == quartz.isState}" type="radio" name="isState" th:value="${value.dictionaryRoute}" th:title="${value.dictionaryName}"  checked  >
                        <input th:if="${value.dictionaryRoute != quartz.isState}" type="radio" name="isState" th:value="${value.dictionaryRoute}" th:title="${value.dictionaryName}">
                </th:block>
            </div>
        </div>
        <input type="hidden" name="id" autocomplete="off" th:value="${quartz.id}">

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="edit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

<div th:include="include::onload"></div>
<script  th:inline="javascript">
    layui.config({
        base: '/js/layer/module/'//模块存放的目录
    }).use(['form','verify'], function(){
        var form = layui.form,
            verify = layui.verify;
        verify.verification();
        form.render('select');
        // 监听提交
        form.on('submit(edit)', function(data) {
            $.achieve.post("/admin/monitor/quartz/update",data.field,"",true);
            return false;
        });
    });

</script>
</body>
</html>